import { PoetryService } from './poetry.service';
import { Controller, Get, Post, Body, Patch, Param, Delete,Query,Req,UseGuards} from '@nestjs/common';
import { CreatePoetryDto} from './dto';
import { LoginGuard } from '../../login/login.guard';
@Controller('poetry')
export class PoetryController {
  constructor(private readonly poetryService: PoetryService) {}

  @UseGuards(LoginGuard)
  @Post('/add')
  create(@Body() CreatePoetryDto: CreatePoetryDto) {
    return this.poetryService.create(CreatePoetryDto);
  }

  //@UseGuards(LoginGuard)
  @Post('/addJson')
  importByJson(@Body() data:[]) {
    return this.poetryService.createJson(data);
  }
}
